package com.tgy.service.impl;


import com.tgy.dao.BooksDao;
import com.tgy.entity.Books;
import com.tgy.service.BooksService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BooksServiceImpl implements BooksService {


    @Resource
    private BooksDao booksDao;



/*    public void setBooksDao(BooksDao booksDao) {
        this.booksDao = booksDao;
    }*/

    @Override
    public List<Books> getAll() {

        return this.booksDao.getAllBooks();
    }

    @Override
    public int add(Books books) {
        return this.booksDao.insert(books);
    }

    @Override
    public int del(int id) {
        return this.booksDao.deleteById(id);
    }

    @Override
    public Books getBookById(int id) {
        return this.booksDao.getBookById(id);
    }

    @Override
    public List<Books> query(Books books) {
        return this.booksDao.query(books);
    }
}
